package muster;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.function.BiConsumer;

/**
 * @author:Administrator
 * @date:2022/1/21
 * @describe:
 */
public class HashMapDome {

    public static void main(String[] args) {
        Map map = new HashMap();
        map.put(10120, "重庆市");
        map.put(10163, "石家庄");
        map.put(10059, "西安市");
        map.put(10079, "咸阳市");
        map.put(10156, "延安市");
        map.put(10099, "武威市");
        map.put(10164, "石嘴山");
        map.put(10166, "北京市");

        System.out.println(map);
        System.out.println("===================第一种遍历方式===================");
        Set keys = map.keySet();
        for (Object key : keys) {
            System.out.print(key + "=" + map.get(key) + " ");
        }
        System.out.println();
        System.out.println("===================第二种遍历方式===================");
        for (Object value : map.values()) {
            System.out.print(value + " ");
        }
        System.out.println();
        System.out.println("===================第三种遍历方式===================");
    }
}
